"""
数据库相关模型
"""
from pydantic import BaseModel
from typing import Optional, Literal

class Database(BaseModel):
    """数据库状态"""
    id: int
    name: str
    host: str
    port: Optional[int] = None
    type: Optional[str] = None
    status: Optional[Literal["running", "stopped", "error", "normal", "warning"]] = "normal"
    connections: Optional[int] = None
    size: Optional[str] = None
    qps: Optional[int] = None
    uptime: Optional[str] = None